package com.hou.hpsj_springboot.mapper;

import com.hou.hpsj_springboot.bean.UserAndVideos_Ext;
import com.hou.hpsj_springboot.bean.Users;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.ArrayList;
@Mapper
public interface UserMapper {
    @Select("SELECT users.*, videos.cover_url ,videos.view_count ,videos.video_url FROM `users`LEFT JOIN videos ON users.id = videos.user_id where users.id=#{id};")
    ArrayList<UserAndVideos_Ext> getUserWork(int id);
    @Select("select * from users where email=#{email}")
     ArrayList<Users> get(String email);
    @Update("update users set username=#{username},phone=#{phone},email=#{email},bio=#{bio} where  phone=#{phone}")
    void update(Users users);
}
